package houseHold.gasObjects;

import houseHold.ObjectType;

import java.util.Vector;

/**
 * Objects that use gas
 * 
 * @author Minodor Class used for matching XML objects to java Objects
 */

public enum GasObjectType implements ObjectType {
	GAS_COOKER, GAS_OBJECT, HEATING, STOVE;
	public Vector<String> getList() {
		Vector<String> ret = new Vector<String>();
		for (GasObjectType g : GasObjectType.values()) {
			ret.add(g.toString());
		}
		ret.remove("GasObject");
		return ret;
	}

	public GasObjectType getObject(String s) {
		for (GasObjectType g : GasObjectType.values()) {
			if (g.toString().equalsIgnoreCase(s))
				return g;
		}
		return null;
	}

	public ObjectType match(String value) {
		return getObject(value);
	}

	@Override
	public String toString() {
		switch (this) {
		case STOVE:
			return "Stove";
		case HEATING:
			return "Heating";
		case GAS_COOKER:
			return "Gascooker";
		default:
			return "GasObject";
		}
	}

}
